package com.dao;

import com.domain.sys.SysRole;
import com.domain.sys.SysRoleMenu;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.ArrayList;

@Mapper
public interface SysRoleDao {

    Integer getRowCount(String name);

    ArrayList<SysRole> findPageObjects(String name,Integer startIndex,Integer pageSize);

    @Delete("delete from sys_roles where id =#{id}")
    Integer deleteObject(Integer id);


    Integer insertObjects(SysRole entity);


    SysRoleMenu findObjectById(Integer id);


    @Update(" update sys_roles" +
            " set" +
            " name=#{name}," +
            " note=#{note}," +
            " modifiedUser=#{modifiedUser}," +
            " modifiedTime=now()" +
            " where id=#{id}")
    Integer updateObject(SysRole entity);
}
